package rs.dalao.syc.common.ex;/*
 *   @author:Casin
 *   @date:2023/8/2
 *   @code:
 */

import rs.dalao.syc.common.response.ServiceCode;

public class ServiceException extends RuntimeException {
    private ServiceCode serviceCode;

    /**快速创建对象并为属性赋值 强制要求传入值*/
    public ServiceException(ServiceCode serviceCode, String message) {
        super(message);
        this.serviceCode = serviceCode;
    }

    /*捕获到这个异常，拿异常对象调用getServiceCode方法来得知状态码*/
    public ServiceCode getServiceCode() {
        return serviceCode;
    }
}
